---
title:  Monitoring and Troubleshooting Transactions
---

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

This topic covers errors that may occur when running transactions in Geode.

<a id="monitor_troubleshoot_transactions__section_881D2FF6761B4D689DDB46C650E2A2E1"></a>
Unlike database transactions, Geode does not write a transaction log to disk. To get the full details about committed operations, use a transaction listener to monitor the transaction events and their contained cache events for each of your transactions.

## <a id="monitor_troubleshoot_transactions__section_2B66338C851A4FF386B60CC5CF4DCF77" class="no-quick-link"></a>Statistics on Cache Transactions

During the operation of Geode cache transactions, if statistics are enabled, transaction-related statistics are calculated and accessible from the CachePerfStats statistic resource. Because the transaction’s data scope is the cache, these statistics are collected on a per-cache basis.

## <a id="monitor_troubleshoot_transactions__section_EA9277E6CFD7423F95BA4D04955FDE2A" class="no-quick-link"></a>Commit

In a failed commit, the exception lists the first conflict that caused the failure. Other conflicts can exist, but are not reported.

## Capacity Limits

A transaction can create data beyond the capacity limit set in the region’s eviction attributes. The capacity limit does not take effect until commit time. Then, any required eviction action takes place as part of the commit.

## <a id="monitor_troubleshoot_transactions__section_C7588E4F143B4D7FAFAEDCF5AE4FF2C8" class="no-quick-link"></a>Interaction with the Resource Manager

The Geode resource manager, which controls overall heap use, either allows all transactional operations or blocks the entire transaction. If a cache reaches the critical threshold in the middle of a commit, the commit is allowed to finish before the manager starts blocking operations.

## <a id="monitor_troubleshoot_transactions__section_8942ABA6F23C4ED58877C894B13F4F21" class="no-quick-link"></a>Transaction Exceptions

The following sections list possible transaction exceptions.

**Exceptions Indicating Transaction Failure**

-   **`TransactionDataNodeHasDepartedException`**. This exception means the transaction host has departed unexpectedly. Clients and members that run transactions but are not a transaction host can get this exception. You can avoid this by working to ensure your transaction hosts are stable and remain running when transactions are in progress.
-   **`TransactionDataNotColocatedException`**. You will get this error if you try to run a transaction on data that is not all located in the same member. Partition your data so that a single member contains all data that will be accessed as part of a single transaction. See [Transactions and Partitioned Regions](cache_transactions_by_region_type.html#concept_ysk_xj1_wk) and [Understanding Custom Partitioning and Data Colocation](../partitioned_regions/custom_partitioning_and_data_colocation.html#custom_partitioning_and_data_colocation).
-   **`TransactionDataRebalancedException`**. You get this error if your transactional data is moved to another member for rebalancing during the transaction. Manage your partitioned region data to avoid rebalancing during a transaction. See [Rebalancing Partitioned Region Data](../partitioned_regions/rebalancing_pr_data.html#rebalancing_pr_data).

**Exceptions Indicating Unknown Transaction Outcome**

-   **`TransactionInDoubtException`**. Some of the transactional operations may have succeeded and some may have failed. This can happen to clients and to any member running a transaction on another data host. To manage this, you may want to install cache listeners in the members running the transaction code. Use the listeners to monitor and record the changes you receive from your transactions so you can recover as needed if you get this exception.

